<template>
    <iframe class="rxiframe build_matrix_box" :src="url" width="100%" height="100%"></iframe>
</template>
<script type="text/ecmascript-6">
export default {
    name: "rx-iframe",
    data() {
        return {
            url: '',
            displacement: {
                scale: 1
            }
        }
    },
    onLoad(option){
        if(option.url && option.url.includes('ureport/preview')){
            this.getUreportUrl(option);
        }else{
            this.url = option.url;
        }

        if(option.title){
            let self = this;
            setTimeout(function (){
                uni.setNavigationBarTitle({
                    title: option.title
                });
            }, 10);
        }
    },
    methods: {
        getUreportUrl(option){
            let ureportPreviewUrl = uni.getStorageSync('ureportPreviewUrl');
            if(!ureportPreviewUrl){
                ureportPreviewUrl = option.url;
            }
            this.url = ureportPreviewUrl;
        }
    },
}
</script>

<style>
.rxiframe {
    border: none;
}
</style>
